package com.holdtime.jtt809dataservice.common.event;


import io.netty.channel.ChannelHandlerContext;
import org.springframework.context.ApplicationEvent;
import protocol.jtt809.JTT809Packet;
import protocol.jtt809.body.RawBody;

/**
 *  author: sunwei
 *  Date: 2025/3/18 17:14
 *  Description:
 */ 
public class ClientMessageReceiveEvent extends ApplicationEvent {
    private static final long serialVersionUID = 1L;
    private JTT809Packet<RawBody> packet;
    private ChannelHandlerContext channelHandlerContext;

    public ClientMessageReceiveEvent(JTT809Packet<RawBody> packet, ChannelHandlerContext channelHandlerContext) {
        super(packet);
        this.packet = packet;
        this.channelHandlerContext = channelHandlerContext;
    }

    @Override
    public JTT809Packet<RawBody> getSource() {
        return packet;
    }

    public int getMsgID() {
        return packet.getMsgID();
    }

    public ChannelHandlerContext getChannelHandlerContext() {
        return channelHandlerContext;
    }
}
